
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
  <style>
    p { margin-left:10px; }
  </style>
  <!-- // <script src="http://code.jquery.com/jquery-latest.js"></script> -->
  <script type="text/javascript" src="../jquery-2.1.1.js"></script>
</head>
<body>
  <p id="aaron">测试位置获取</p>
<script>
var elem = document.getElementById('aaron')
var box = elem.getBoundingClientRect();
//IE浏览器的<html>文档根元素默认是有2px边框的,减去clientTop
var etop = box.top + window.pageYOffset - document.documentElement.clientTop
var eleft = box.left + window.pageXOffset - document.documentElement.clientLeft





</script>
 
</body>
</html>